<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <script>
        var zhangsan = {
            name: "zhangsan",
            age: 18,
            child: { name: "张三丰", child: { name: "张四" } },
        };

        var childChild = { name: zhangsan.child.child.name }
        var child = { name: zhangsan.child.name, child: childChild }

        var lisi = { name: zhangsan.name, age: zhangsan.age, child: child }

        console.log(lisi === zhangsan);
        console.log(lisi.child === zhangsan.child);
        console.log(lisi.child.child === zhangsan.child.child);

      // 深拷贝 zhangsan对象
    </script>
</body>

</html>